package org.annotationz.lambda_test;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.Map;

public class EqInvoicationHandler<T> implements InvocationHandler {

    private T instance;
    private Map<String, Object> map;

    public EqInvoicationHandler(T instance, Map<String, Object> map) {
        this.instance = instance;
        this.map = map;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        // for (Object arg : args) {
        //     System.out.println("arg = " + arg);
        // }
        System.err.println("method.getName() = " + method.getName());
        Object result = method.invoke(instance, args);
        return result;
    }
}
